# sifus

CXX = g++

CXXFLAGS = -I. -I /usr/include/libcfitsio0/ -O3 -fprefetch-loop-arrays -fomit-frame-pointer -funroll-loops -finline-functions -ffast-math \
        -lMatrix \
	`root-config --libs --glibs --cflags --ldflags --auxlibs --auxcflags`\
	`root-config --cflags`

LDFLAGS = -L/usr/lib -L/usr/root/lib -lCore -lMinuit -lGpad -pthread -lm -ldl -lcfitsio `root-config --libs --glibs --ldflags --auxlibs --auxcflags`

OBJECTS = m.o image.o gauss.o ifu.o
INCLUDES = ifu.h image.h nrutil.h

# compila com debug symbols se DEBUG estiver setado
# ifeq ($(DEBUG),1)
# 	DBG = -g2 -ggdb
# 	CXXFLAGS = -W -Wall -I. -I/usr/include/root `root-config --cflags`
# else
# 	DBG =
# endif
# 
# ifeq ($(PROFILE),1)
# 	DBG = -g2 -ggdb -pg
# 	CXXFLAGS = -W -Wall -I. -I/usr/include/root `root-config --cflags`
# 	LDFLAGS += -pg
# endif

# regras

all: lifu

lifu: $(OBJECTS) 
	$(CXX) $(LDFLAGS) $(CXXFLAGS) -o $@ $^ libnrc.a
	\cp lifu ../bin/
	\cp lifu ~/bin/

%.o: %.cpp %.h
	$(CXX) $(CXXFLAGS) $(DBG) -c -o $@ $<
	$(CXX) -pthread -m64 -I/usr/include/root $(DBG) -c -o $@ $<

clean:
	-@ rm -f *.o lifu TAGS

tags:
	-@ etags *.{cpp,h} --declarations --members
